fix: reject invalid hex and merge tokens in color sanitize - #212
Merged
Merged
Conversation
The prior HEX_PATTERN treated 5-digit values like #00000 as valid, so
they still reached Pixi Color and threw. Align with Pixi's 3/4/6/8 rule,
cover unsubstituted {{ VAR }} tokens, and sanitize timeline background
fills before Graphics fillStyle.
github-actions Bot
pushed a commit
that referenced
this pull request
Sep 29, 2026
## [2.23.2](v2.23.1...v2.23.2) (2026-09-29) ### Bug Fixes * reject invalid hex and merge tokens in color sanitize ([#212](#212)) ([5874685](5874685)), closes [#00000](https://github.com/shotstack/shotstack-studio-sdk/issues/00000)
|
🎉 This PR is included in version 2.23.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sanitizeColorhex matching so only Pixi-valid lengths (3/4/6/8) pass — 5-digit values like#00000previously slipped through and crashedTextStyle/Color.{{ BG_COLOR }}.fillStyle(init + viewport update) so invalid document backgrounds no longer throw.Test plan
#00000,#12345,{{ BG_COLOR }}fall back; valid 3/4/6/8 hex preservedfont.color: "#00000"and timelinebackground: "{{ BG_COLOR }}"; confirm studio loads with no Pixi convert-color crash